<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    
</body>
<script>
    var a = Math.round(Math.random() * (-100));
    // console.log(a);
    var b = Math.round(Math.random() * 100);
    // console.log(b);
    var x = a + b;
    console.log(x);

    if(x < 1){
        var y = x;
        // console.log(y);
        document.write("当x=" + x);
        document.write("<br>) y=" + y);
    }else if(x < 10 && x >= 1){
        var y = x * 2 + 1;
        // console.log(y);
        document.write("当x=" + x);
        document.write("<br> y=" + y);
    }else if(x >= 10){
        var y = x * 5 - 17;
        // console.log(y);
        document.write("当x=" + x);
        document.write("<br> y=" + y);
    }
</script>
</html>